home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 2000
/
MacHack 2000.toast
/
pc
/
The Hacks
/
Softshoe
/
Lisa's Mac Parts
/
Views
/
ViewCell
/
CellClicker.cp
next >
Wrap
Text File
|
2000-06-23
|
854b
|
40 lines
// CellClicker.cp
#ifndef CellClicker_h
#include "CellClicker.h"
#endif
#ifndef ViewCell_h
#include "ViewCell.h"
#endif
#ifndef MouseDownEvent_h
#include "MouseDownEvent.h"
#endif
#ifndef Canvas_h
#include "Canvas.h"
#endif
#ifndef CanvasMaintainer_h
#include "CanvasMaintainer.h"
#endif
CellClicker::CellClicker( const MouseDownEvent& theEvent )
: CellVisitor( Rectangle( theEvent.LocalPoint().h,
theEvent.LocalPoint().v,
theEvent.LocalPoint().h + 1,
theEvent.LocalPoint().v + 1 ) ),
event( theEvent )
{
}
void CellClicker::Visit( ViewCell& cell, const Canvas& canvas )
{
Assert( canvas.Visible() );
Assert( canvas.Clip().Contains( event.LocalPoint() ) );
CanvasMaintainer cm( canvas );
if ( event.Activating() )
cell.ActivatingClick( canvas, event );
else
cell.Click( canvas, event );
}